#https://docs.unstructured.io/open-source/introduction/quick-start
from unstructured.partition.auto import partition


from unstructured.staging.base import convert_to_csv


from unstructured.partition.html import partition_html

url="https://docs.unstructured.io/open-source/core-functionality/chunking"


from unstructured.partition.html import partition_html

chunks = partition_html(url=url, chunking_strategy="basic")

print("\n\n".join([str(el) for el in chunks]))

elements = partition(filename="md.md")

isd_csv = convert_to_csv(elements)

'''
chunks = partition_html(url=url, chunking_strategy="basic")


elements = partition(filename="md.md")

isd_csv = convert_to_csv(elements)

print(isd_csv)




elements = partition(filename="md.md")

print("\n\n".join([str(el) for el in elements]))


from unstructured.cleaners.extract import extract_datetimetz

text = """from ABC.DEF.local ([ba23::58b5:2236:45g2:88h2]) by
  \n ABC.DEF.local2 ([ba23::58b5:2236:45g2:88h2%25]) with mapi id\
  n 32.88.5467.123; Fri, 26 Mar 2021 11:04:09 +1200"""

# Returns datetime.datetime(2021, 3, 26, 11, 4, 9, tzinfo=datetime.timezone(datetime.timedelta(seconds=43200)))
extract_datetimetz(text)
'''